<?php

	require_once(APPPATH . 'controllers/base_controllers/base_validation_controller.php');
	
	class Sponsor_validation extends Base_validation_controller
	{
		
		public function __construct()
		{
			parent::__construct();
			
			$this->load->library('validation');
		}
		
		
		public function validate_sponsor_amount()
		{
			$rules['sponsorshipAmount'] = "trim|required|numeric|callback_valid_dollar_check";
			
			$this->validation->set_rules($rules);
			
			$validationPassed = $this->validation->run();
			
			if($validationPassed)
			{
				echo( 'VALIDATION_SUCCESS' );
			}
			else
			{
				echo( $this->clean_validation_errors( $this->validation->error_string ) );
			}
			
			die;
		}
		
		
		private function clean_validation_errors( $valErrors )
		{
			$valErrors = str_replace("sponsorshipAmount", "Sponsorship Amount", $valErrors);
			
			return $valErrors;
		}
		
		
	}

?>